<?php
class Perso_Validate_Phone extends Zend_Validate_Abstract
{
    const NOT_VALID = 'phoneInvalid';

    protected $_messageTemplates = array(																		
        self::NOT_VALID => "Phone number '%value%' must be in the format +COUNTRYCODE.PHONENUMBER. Example: +41.781234567"
    );

    public function isValid($value)
    {
        $this->_setValue($value);

        if (!preg_match('/^\+([0-9]+)\.([0-9]{9})$/',$value)) {
            $this->_error(self::NOT_VALID);
            return false;
        }

        return true;
    }
}